package br.ufpe.cin.camid.remote.distribution.interceptor;

import org.aopalliance.intercept.MethodInterceptor;

public class OrderedInterceptor implements Comparable<OrderedInterceptor>{

	private final MethodInterceptor interceptor;
	
	private final int priority;
	
	public OrderedInterceptor(final MethodInterceptor interceptor, final int priority)
	{
		this.interceptor = interceptor;
		this.priority = priority;
	}

	public MethodInterceptor getInterceptor() {
		return interceptor;
	}

	public int getPriority() {
		return priority;
	}
	
	@Override
	public int compareTo(OrderedInterceptor interceptorPriority) {
		
		return this.priority - interceptorPriority.priority;
	}

	
	
	
	
}
